<extend name="Base/common"/>
<block name="style">
    <style type="text/css">

    </style>
</block>
<block name="body">
    <php>
        if($info['paytype']==1){
            $body  = '订单号'.$info['loan_id'];
            $title = '订单号'.$info['loan_id'];
        }else{
            $body  = '订单号'.$info['loan_id'];
            $title = '订单号'.$info['loan_id'];
        }
    </php>

    <form method="post" action="{:U('')}">
        <input type="hidden" name="out_trade_no" value="{$info.id}">
        <input type="hidden" name="title" value="{$title}">
        <input type="hidden" name="total_amount" value="{$info.money}">
        <input type="hidden" name="body" value="{$body}">

    <div class="weui-cells">

        <div style="text-align: center;width:100%;display: block;font-size: 1.5em;padding-top:0.5em " class="">支付金额</div>
            <div style="text-align: center;width:100%;padding-top:0.2em;padding-bottom: 0.8em;display: block;font-size: 1.2em;" class="">{$info.money}</div>
    </div>


    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <p>收款方</p>
            </div>
            <div class="weui-cell__ft">南宁笑笑网络科技有限公司</div>
        </div>

        <div class="weui-cell">
            <div class="weui-cell__bd">
                <p>订单号</p>
            </div>
            <div class="weui-cell__ft">{$info.id}</div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <p>下单时间</p>
            </div>
            <div class="weui-cell__ft">{$info.create_time|date='Y-m-d H:i:s',###}</div>
        </div>
    </div>
        <div class="page__bd page__bd_spacing" style="padding-top: 2em;">
            <button class="weui-btn weui-btn_primary weixin1" style="display: none" type="submit">立即支付</button>
            <button class="weui-btn weui-btn_primary weixin2" type="button">立即支付</button>
        </div>
    </form>
    <div class="page__bd page__bd_spacing" style="padding-top: 2em;">
        支付完成请耐心等候3~5秒钟再关闭浏览器哦亲~iPhone用户在APP支付后请手动切换至浏览器~
    </div>
</block>
<block name="script">
    <script >

        function is_weixin() {
           var ua = navigator.userAgent.toLowerCase();
            if (ua.match(/MicroMessenger/i) == "micromessenger") {
                return true;
            } else {
               $('.weixin1').show();
               $('.weixin2').hide();
                return false;
            }
        }
        is_weixin();
        Zepto(function($){
                $('.weixin2').click(function(){
                    var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight;
                    var weixinTip = $('<div id="weixinTip"><p><img style="width: 100%;" src="__IMG__/live_weixin.png" alt="微信打开"/></p></div>');
                    $("body").append(weixinTip);
                    $("#weixinTip").css({
                        "position":"fixed",
                        "left":"0",
                        "top":"0",
                        "height":winHeight,
                        "width":"100%",
                        "z-index":"1000",
                        "background-color":"rgba(0,0,0,0.8)",
                        "filter":"alpha(opacity=80)",
                    });
                    $("#weixinTip p").css({
                        "text-align":"center",
                        "margin-top":"10%",
                        "padding-left":"5%",
                        "padding-right":"5%"
                    });
                });

              /*  $(window).on("load",function(){
                var winHeight = $(window).height();

                var isWeixin = is_weixin();
                if(isWeixin){
                $(".weixin-tip").css("height",winHeight);
                $(".weixin-tip").show();
                }
                })*/
        });
    </script>

</block>